using System.ComponentModel.DataAnnotations;

namespace MES工单_MVC.Models
{
    public class OpenFareModel
    {
        public int Id { get; set; }
        
        [Required(ErrorMessage = "开票编号不能为空")]
        [Display(Name = "开票编号")]
        public string OpenFareCode { get; set; }
        
        [Required(ErrorMessage = "开票主题不能为空")]
        [Display(Name = "开票主题")]
        public string OpenFareTheme { get; set; }
        
        [Required(ErrorMessage = "发票类型不能为空")]
        [Display(Name = "发票类型")]
        public string InvoiceTypeName { get; set; }
        
        [Required(ErrorMessage = "开票日期不能为空")]
        [Display(Name = "开票日期")]
        [DataType(DataType.Date)]
        public DateTime OpenFareTime { get; set; }
        
        [Required(ErrorMessage = "收票方不能为空")]
        [Display(Name = "收票方")]
        public string CollectTickets { get; set; }
        
        [Required(ErrorMessage = "开票金额不能为空")]
        [Display(Name = "开票金额")]
        [Range(0.01, double.MaxValue, ErrorMessage = "开票金额必须大于0")]
        public decimal OpenFareMoney { get; set; }
        
        [Required(ErrorMessage = "发票号不能为空")]
        [Display(Name = "发票号")]
        public string InvoiceTypeCode { get; set; }
        
        [Display(Name = "备注")]
        public string OpenFareRemark { get; set; }
        
        [Display(Name = "创建时间")]
        public DateTime CreateTime { get; set; } = DateTime.Now;
        
        [Display(Name = "更新时间")]
        public DateTime? UpdateTime { get; set; }
    }
}
